 <template>
 	<uv-popup ref="popupRef" mode="center" bg-color="transparent" :overlay-style="{
      'background': `rgba(0, 0, 0,0.5)`}" @mask-click="close">
 		<view class="popup-content relative">
 			<view class="box">
 				<view class="top_img">
 					<image src="@/static/img/ticket/close.png" mode="" @click="close" />
 				</view>
 				<view class="top_cont">
 					<image class="bg_img"
 						src="https://seven-3121.obs.cn-north-4.myhuaweicloud.com/2025%2F7%2F14%2Fmodal_bg.png" mode="">
 					</image>
 					<image v-if="form.status === 0" class="isPass_img"
 						src="https://seven-3121.obs.cn-north-4.myhuaweicloud.com/2025%2F7%2F16%2F%E5%BE%85%E6%A0%B8%E9%AA%8C%402x.png"
 						mode="">
 					</image>
 					<image v-else class="isPass_img"
 						src="https://seven-3121.obs.cn-north-4.myhuaweicloud.com/2025%2F7%2F16%2F%E5%BE%85%E6%A0%B8%E9%AA%8C%402x+%281%29.png"
 						mode="">
 					</image>

 					<view class="form_data">
 						<view class="top_title">
 							<image
 								src="https://seven-3121.obs.cn-north-4.myhuaweicloud.com/2025%2F7%2F16%2Fimage%402x+%281%29.png" />
 							{{form.name}}
 						</view>
 						<view class="buy_info">
 							{{form.info}}
 						</view>
 						<view class="b_info">
 							<view class="">
 								<text>卷码编号</text>
 								<text>{{form.code}}</text>
 							</view>
 							<view class="">
 								<text>兑换时间</text>
 								<text>{{form.createTime}}</text>
 							</view>
 							<view class="">
 								<text>到期日期</text>
 								<text>{{form.endTime}}</text>
 							</view>
 						</view>
 					</view>

 					<view :class="form.status===0?'t_btn':'t_btn no_btn' " @click="handleHome">
 						{{form.status === 0?'确认核验':'禁止重复核验' }}
 					</view>
 				</view>
 			</view>
 		</view>
 	</uv-popup>
 </template>


 <script>
 	import {
 		handleVerDis
 	} from "@/api/app/index.js"

 	export default {
 		data() {
 			return {
 				form: {}
 			}
 		},
 		created() {
 			// var that = this
 			// that.$nextTick(() => {
 			// 	that.$refs.popupRef.open('center')
 			// })
 		},

 		methods: {
 			open() {
 				this.$refs.popupRef.open('center')
 				this.$emit('onOpen')
 			},

 			close() {
 				this.$refs.popupRef.close()
 				this.$emit('closePass')
 			},

 			// 核验优惠券
 			handleHome() {
 				if (this.form.status === 0) {
 					handleVerDis({
 						recordId: this.form.recordId
 					}).then(res => {
 						if (res.code === 200) {
 							uni.showToast({
 								title: '核验成功',
 								icon: 'success'
 							})
 							this.$refs.popupRef.close()
 							this.$emit('closePass')
 						}
 					})
 				}
 			},
 		}
 	}
 </script>


 <style lang="scss" scoped>
 	.box {
 		width: 672rpx;
 		height: auto;
 		border-radius: 16rpx;
 		overflow: hidden;
 	}

 	.top_img {
 		width: 100%;
 		height: 120rpx;
 		text-align: right;
 	}

 	.top_img image {
 		width: 120rpx;
 		height: 120rpx;
 		cursor: pointer;
 	}

 	.top_cont {
 		width: 100%;
 		height: auto;
 		border-radius: 16rpx;
 		position: relative;
 		background: linear-gradient(180deg, #E3EEFF 0%, #FBFBFF 100%);
 		overflow: hidden;
 	}

 	.bg_img {
 		width: 304rpx;
 		height: 304rpx;
 		position: absolute;
 		top: 0;
 		right: 0;
 		z-index: 1;
 	}

 	.isPass_img {
 		width: 162rpx;
 		height: 146rpx;
 		position: absolute;
 		top: 32rpx;
 		left: 24rpx;
 	}

 	.t_btn {
 		width: calc(100% - 48rpx);
 		height: 82rpx;
 		margin-left: 24rpx;
 		margin-right: 24rpx;

 		border-radius: 76rpx;
 		background: #438DFF;
 		margin-bottom: 42rpx;

 		font-family: Source Han Sans;
 		font-size: 32rpx;
 		font-weight: 500;
 		color: #FFFFFF;

 		display: flex;
 		align-items: center;
 		justify-content: center;
 	}


 	.form_data {
 		width: calc(100% - 48rpx);
 		height: auto;
 		border-radius: 26rpx;
 		background: #F5F9FB;
 		box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.2);
 		margin-bottom: 40rpx;
 		list-style: none;
 		padding: 34rpx;
 		box-sizing: border-box;
 		margin: 160rpx 24rpx 46rpx 24rpx;
 	}

 	.top_title {
 		width: 100%;
 		height: auto;
 		overflow: hidden;
 		display: flex;
 		align-items: center;
 		justify-content: flex-start;

 		font-family: Source Han Sans;
 		font-size: 32rpx;
 		color: #3D3D3D;
 		margin-bottom: 20rpx;
 	}

 	.top_title image {
 		width: 62rpx;
 		height: 62rpx;
 		margin-right: 6rpx;
 	}

 	.buy_info {
 		width: 100%;
 		max-height: 162rpx;
 		font-family: Source Han Sans;
 		font-size: 28rpx;
 		font-weight: 350;

 		padding: 20rpx 24rpx;
 		background-color: #fff;
 		border-radius: 26rpx;
 		background: #FFFFFF;
 		box-shadow: inset 0px 0px 1px 0px rgba(0, 0, 0, 0.2);
 		margin-bottom: 28rpx;
 		box-sizing: border-box;
 	}



 	.b_info {
 		width: 100%;
 	}

 	.b_info>view {
 		width: 100%;
 		margin-bottom: 12rpx;
 		display: flex;
 		align-items: center;
 		justify-content: space-between;

 		font-family: Source Han Sans;
 		font-size: 24rpx;
 	}

 	.b_info>view:last-child {
 		margin-bottom: 0;
 	}

 	.b_info>view text:first-child {
 		color: rgba(0, 0, 0, 0.4);
 	}

 	.b_info>view text:last-child {
 		color: rgba(0, 0, 0, 0.7);
 	}

 	.no_btn {
 		background: rgba(0, 0, 0, 0.4);
 		color: #FFFFFF;
 	}
 </style>